package Offer.offer2018;

/**
 * 求两个数需要几次转换
 * Created by 雷文康 on 2018/3/3.
 */
public class Test10b {

    public static int changeTime(int num1, int num2) {
        int num3 = num1 ^ num2;

        int count = 0;
        while (num3 != 0) {
            count++;
            num3 = num3 & (num3 - 1);
        }
        return count;
    }
}
